﻿using System;

using MaLu.Common;
using System.Data;
using MaLu.Data;
using MaLu.Framework.Common;


namespace MaluJg.web.Move
{
    public partial class item2 : MovePage
    {
       

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dt = SqlHelper.Instance.ExecuteDataTable(Provider, "select  * from moving where id=" + MID);
                if (dt.Rows.Count > 0)
                {
                    DataRow dr = dt.Rows[0];
                    tbQianYue.Text = dr["QianYue"].ToString();
                    tbQianYueJia.Text = dr["QianYueJia"].ToString();
                    tbBuchangSum.Text = dr["BuChangSum"].ToString();
                    tbSecondRemark.Text = dr["SecondRemark"].ToString();
                }

            }
        }
      
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string sql = string.Format(@"UPDATE [Moving]
   SET [QianYue] ={0}
      ,[QianYueJia] ={1},[SecondRemark]={2},Second=1,BuChangSum={3} where ID={4}", Util.ReturnSqlValue(tbQianYue.Text), Util.ReturnSqlValue(tbQianYueJia.Text), Util.ReturnSqlValue(tbSecondRemark.Text), Util.ReturnSqlValue(tbBuchangSum.Text), MID);
            SqlHelper.Instance.ExecuteNonQuery(Provider, sql);
          
            ClientScript.RegisterStartupScript(this.GetType(), "Close", "<script>alert('成功保存!');</script>");
        }
    }
}
